<template>
	<div id="app">
	<h3>	<img src="../static/img/logos.png"/>
	文章详情
	</h3>
	<div class="info">
		<h3>标题：{{info.title}}</h3>
		<h3>userId：{{info.userId}}</h3>
		<h3>id：{{info.id}}</h3>
		<h3>body：{{info.body}}</h3>
	</div>
	</div>
</template>
<script>
	export default{
		name:'clubinfo',
		data(){
			return{
				id:this.$route.params.id,
				info:{},
				
			}
		},
//		created(){
//this.$axios.get('http://jsonplaceholder.typicode.com/posts/'+this.id).then(response => {
//  var res=response.data;
//  this.info=res;
//}, response => {
//  alert('请求失败！');
//});
//		}
		created(){
this.$axios.get('http://jsonplaceholder.typicode.com/posts/',
   {
    params:{            
        id:this.id
    }
}
).then(response => {
    var res=response.data;
    this.info=res[0];
   console.log(res[0])
  }, response => {
    alert('请求失败！');
  });
		}
	}
</script>
<style>
	li{
		font-size: 16px;
		border-bottom: dashed 1px gray;
		margin-bottom: 10px;
	}
	.info{
		width:50%;
	    margin-left:5%;
		border: solid 1px royalblue;
		padding: 20px;
	}
</style>